<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/dingmanagement/ordermanagement/mes_ordermanagement.jsx此处编写
 -->
<template>
    <view-grid ref="grid"            
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/dingmanagement/ordermanagement/mes_ordermanagement.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '订单管理',
                name: 'ordermanagement/mes_ordermanagement',
                url: "/mes_ordermanagement/",
                sortName: "Id"
            });
            const editFormFields = ref({"o_number":"","xiadan_date":"","kh_id":"","kh_name":"","jiaohuo_date":"","contract_no":"","contract_time":"","contract_address":"","Comment":"","shuilv":"","weishui":""});
            const editFormOptions = ref([[{"title":"订单编号","field":"o_number"},
                               {"title":"下单日期","field":"xiadan_date"},
                               {"title":"客户id","field":"kh_id","type":"number"},
                               {"title":"客户名称","field":"kh_name"}],
                              [{"title":"交货日期","field":"jiaohuo_date"},
                               {"title":"合同号","field":"contract_no"},
                               {"title":"合同时间","field":"contract_time"},
                               {"title":"合同地址","field":"contract_address"}],
                              [{"title":"备注","field":"Comment"},
                               {"title":"税率","field":"shuilv"},
                               {"title":"未税","field":"weishui"}]]);
            const searchFormFields = ref({"o_number":"","xiadan_date":"","Comment":"","kh_name":"","yuqi":[null,null],"status":"","production_status":""});
            const searchFormOptions = ref([[{"title":"订单编号","field":"o_number","type":"text"},{"title":"下单日期","field":"xiadan_date","type":"date"},{"title":"备注","field":"Comment","type":"text"},{"title":"客户名称","field":"kh_name","type":"text"},{"title":"逾期天数","field":"yuqi","type":"range"},{"title":"状态","field":"status","type":"text"},{"title":"生产状态","field":"production_status","type":"text"}]]);
            const columns = ref([{field:'Id',title:'主键',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'o_number',title:'订单编号',type:'string',width:220,align:'left',sort:true},
                       {field:'o_barcode',title:'订单条码',type:'string',width:220,align:'left'},
                       {field:'xiadan_date',title:'下单日期',type:'string',width:220,align:'left'},
                       {field:'jiaohuo_date',title:'交货日期',type:'string',width:220,align:'left'},
                       {field:'Comment',title:'备注',type:'string',width:220,align:'left'},
                       {field:'kh_id',title:'客户id',type:'int',width:110,align:'left'},
                       {field:'kh_name',title:'客户名称',type:'string',width:220,align:'left'},
                       {field:'create_time',title:'创建时间',type:'string',width:220,align:'left'},
                       {field:'wancheng_date',title:'完成日期',type:'string',width:220,align:'left'},
                       {field:'wancheng_status',title:'完成状态',type:'string',width:220,align:'left'},
                       {field:'gongxu_name',title:'工序名称',type:'string',width:220,align:'left'},
                       {field:'gongxu_no',title:'工序编号',type:'string',width:220,align:'left'},
                       {field:'yuqi',title:'逾期天数',type:'int',width:110,align:'left'},
                       {field:'shengyu',title:'剩余天数',type:'int',width:110,align:'left'},
                       {field:'fahuo',title:'发货日期',type:'string',width:220,align:'left'},
                       {field:'shoukuan',title:'收款日期',type:'string',width:220,align:'left'},
                       {field:'status',title:'状态',type:'string',width:220,align:'left'},
                       {field:'is_xiafa',title:'是否下发',type:'string',width:220,align:'left'},
                       {field:'is_ruku',title:'是否入库',type:'string',width:220,align:'left'},
                       {field:'fapiao',title:'是否已开发票',type:'string',width:220,align:'left'},
                       {field:'goods_info',title:'商品信息',type:'string',width:110,align:'left'},
                       {field:'chengben',title:'成本',type:'decimal',width:110,align:'left'},
                       {field:'p_id',title:'关联成产id',type:'string',width:220,align:'left'},
                       {field:'all_price',title:'订单总金额',type:'decimal',width:110,align:'left'},
                       {field:'receivable',title:'应收金额',type:'decimal',width:110,align:'left'},
                       {field:'received',title:'已收金额',type:'decimal',width:110,align:'left'},
                       {field:'invoice_receivable',title:'应收发票',type:'decimal',width:110,align:'left'},
                       {field:'invoice_received',title:'已收发票',type:'decimal',width:110,align:'left'},
                       {field:'contract_no',title:'合同号',type:'string',width:220,align:'left'},
                       {field:'contract_time',title:'合同时间',type:'string',width:220,align:'left'},
                       {field:'contract_address',title:'合同地址',type:'string',width:220,align:'left'},
                       {field:'surface_treatment',title:'表面处理',type:'string',width:220,align:'left'},
                       {field:'packing',title:'包装',type:'string',width:220,align:'left'},
                       {field:'production_status',title:'生产状态',type:'string',width:220,align:'left'},
                       {field:'yuguchengben',title:'预估成本',type:'decimal',width:110,align:'left'},
                       {field:'yuguyuancailiao',title:'预估原材料',type:'decimal',width:110,align:'left'},
                       {field:'yugurengong',title:'预估人工',type:'decimal',width:110,align:'left'},
                       {field:'yuguqita',title:'预估其他',type:'decimal',width:110,align:'left'},
                       {field:'last_delivery_time',title:'最晚发货日期',type:'string',width:220,align:'left'},
                       {field:'shijiyuancailiao',title:'实际原材料',type:'decimal',width:110,align:'left'},
                       {field:'shijirengong',title:'实际人工',type:'decimal',width:110,align:'left'},
                       {field:'shijiqita',title:'实际其他',type:'decimal',width:110,align:'left'},
                       {field:'scrap_loss',title:'不知道这啥',type:'decimal',width:110,align:'left'},
                       {field:'receivable_plan',title:'预估应收金额',type:'decimal',width:110,align:'left'},
                       {field:'BiZhong',title:'币种id',type:'string',width:220,align:'left'},
                       {field:'bz_name',title:'币种名称',type:'string',width:220,align:'left'},
                       {field:'exchange_rate',title:'当时汇率',type:'decimal',width:110,align:'left'},
                       {field:'yuanbijine',title:'原币金额',type:'decimal',width:110,align:'left'},
                       {field:'yuanbi_received',title:'原币应收金额',type:'decimal',width:110,align:'left'},
                       {field:'yuanbi_receivable',title:'原币已收金额',type:'decimal',width:110,align:'left'},
                       {field:'yuanbi_invoice_received',title:'原币应收发票',type:'decimal',width:110,align:'left'},
                       {field:'yuanbi_invoice_receivable',title:'原币实收发票',type:'decimal',width:110,align:'left'},
                       {field:'type',title:'1成品2原材料',type:'string',width:110,align:'left'},
                       {field:'ShouHuoMen',title:'收货人',type:'string',width:220,align:'left'},
                       {field:'ShouHuoAdress',title:'收货地址',type:'string',width:220,align:'left'},
                       {field:'ShouHuoTel',title:'收货人联系方式',type:'string',width:220,align:'left'},
                       {field:'shuilv',title:'税率',type:'string',width:220,align:'left'},
                       {field:'weishui',title:'未税',type:'string',width:220,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
